3.73 \(\int \frac{2-3 x+x^2}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=11 \[ \log (x+1)-\log (x+2) \]

[Out]

Log[1 + x] - Log[2 + x]

________________________________________________________________________________________

Rubi [A]  time = 0.0101318, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {1586, 616, 31} \[ \log (x+1)-\log (x+2) \]

Antiderivative was successfully verified.

[In]

Int[(2 - 3*x + x^2)/(4 - 5*x^2 + x^4),x]

[Out]

Log[1 + x] - Log[2 + x]

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{2-3 x+x^2}{4-5 x^2+x^4} \, dx &=\int \frac{1}{2+3 x+x^2} \, dx\\ &=\int \frac{1}{1+x} \, dx-\int \frac{1}{2+x} \, dx\\ &=\log (1+x)-\log (2+x)\\ \end{align*}

Mathematica [A]  time = 0.0027395, size = 11, normalized size = 1. \[ \log (x+1)-\log (x+2) \]

Antiderivative was successfully verified.

[In]

Integrate[(2 - 3*x + x^2)/(4 - 5*x^2 + x^4),x]

[Out]

Log[1 + x] - Log[2 + x]

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 12, normalized size = 1.1 \begin{align*} \ln \left ( 1+x \right ) -\ln \left ( 2+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2-3*x+2)/(x^4-5*x^2+4),x)

[Out]

ln(1+x)-ln(2+x)

________________________________________________________________________________________

Maxima [A]  time = 0.963834, size = 15, normalized size = 1.36 \begin{align*} -\log \left (x + 2\right ) + \log \left (x + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

-log(x + 2) + log(x + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.51612, size = 35, normalized size = 3.18 \begin{align*} -\log \left (x + 2\right ) + \log \left (x + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

-log(x + 2) + log(x + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.097253, size = 8, normalized size = 0.73 \begin{align*} \log{\left (x + 1 \right )} - \log{\left (x + 2 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2-3*x+2)/(x**4-5*x**2+4),x)

[Out]

log(x + 1) - log(x + 2)

________________________________________________________________________________________

Giac [A]  time = 1.08595, size = 18, normalized size = 1.64 \begin{align*} -\log \left ({\left | x + 2 \right |}\right ) + \log \left ({\left | x + 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2-3*x+2)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

-log(abs(x + 2)) + log(abs(x + 1))